package com.github.boluo1230.wechat.controller;

import com.github.boluo1230.wechat.base.ServerResponse;
import com.github.boluo1230.wechat.entity.MpApp;
import com.github.boluo1230.wechat.entity.vo.UserVo;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Code Farmer
 * @date 2019/11/12 20:30
 */
@RestController
@RequestMapping("/user")
@AllArgsConstructor
public class UserController {

    /**
     * 用户登录
     *
     * @return
     */
    @PostMapping("/login")
    public ServerResponse login(@RequestBody UserVo userVo) {
//        List<MpApp> mpAppList = loginService.;
        Map map = new HashMap<String, Object>();
        map.put("name", "super_admin");
        map.put("user_id", "1");
        map.put("access", new String[]{"super_admin", "admin"});
        map.put("token", "super_admin");
        map.put("avator", "https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png");

        return ServerResponse.createBySuccess(map);
    }

}
